import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
const router = createRouter({
	// history: createWebHistory(import.meta.env.BASE_URL),
	history: createWebHashHistory(import.meta.env.BASE_URL),
	routes: [
		{
			path: '/',
			name: 'index',
			// route level code-splitting
			// this generates a separate chunk (About.[hash].js) for this route
			// which is lazy-loaded when the route is visited.
			component: () => import('@/views/IndexV.vue')
		},
		{
			path: '/admin',
			name: 'admin',
			// route level code-splitting
			// this generates a separate chunk (About.[hash].js) for this route
			// which is lazy-loaded when the route is visited.
			// 添加重定向规则
			redirect: '/admin/index',
			component: () => import('@/layout/AdminLayout.vue'),
			children: [{
				path: 'index',
				name: 'adminIndex',
				component: () => import('@/views/IndexV.vue')
			}]
		},
	]
})

export default router
